import { AnyAction } from 'redux';

function counter(state: any = { count: 0 }, action: AnyAction): any {
  switch (action.type) {
    case 'INCREMENT':
      return { count: state.count + 1 };
    case 'DECREMENT':
      return { count: state.count - 1 };
    default:
      return state;
  }
}

export default counter;